/*
 * @Author: Cenven
 * @Date: 2021-03-15 17:36:23
 * @Description: 北京泓深教育发展有限公司
 * @Descripttion:
 * @version: @Lastest
 * @LastEditTime: 2021-09-23 14:57:00
 * @CopyRight: 北京泓深教育发展有限公司
 */
import http from "~/utils/http";
/* 获取题库列表 */
export const getQuestionBankList = data => {
  return http({
    url: "client/questionGroup/list",
    method: "post",
    data
  });
};
/* 获取我的考试记录 */
export const getMyTestRecord = data => {
  return http({
    url: "questionDonePaper/getExamRecordsPage",
    method: "post",
    data
  });
};
/* 获取我购买的题库（含进度） */
export const getMyQuestion = data => {
  return http({
    url: "questionGroupRecords/getMyQuestionGroupPage",
    method: "post",
    data
  });
};
/* 获取我购买的单个题库（含进度） */
export const getMyQuestionGroupById = data => {
  return http({
    url: "questionGroupRecords/getMyQGByQGId",
    method: "post",
    data
  });
};
/* 获取单个题库 */
export const getQuestionBankOne = id => {
  return http({
    url: "questionGroup/selectOne?id=" + id,
    method: "get"
  });
};
/* 获取题库专业树结构 */
export const getQuestionBankMajorList = data => {
  return http({
    url: "questionMajor/useList",
    method: "post",
    data
  });
};
/* 获取题库专业列表 */
export const getQuestionMajorList = () => {
  return http({
    url: "questionMajor/getAll",
    method: "get",
  });
};
/* 获取题库章节树 */
export const getQuestionBankChapterTree = data => {
  return http({
    url: "questionGroupChapter/listTree",
    method: "post",
    data
  });
};
/* 获取题库章节列表 */
export const getQuestionBankChapterList = data => {
  return http({
    url: "questionGroupChapter/listChapter",
    method: "post",
    data
  });
};
/* 获取章节单条数据 */
export const getQuestionBankChapterQuestions = id => {
  return http({
    url: "questionGroupChapter/selectOne?id=" + id,
    method: "get"
  });
};
/* 章节练习做题保存 */
export const saveChapterPractice = data => {
  return http({
    url: "questionGroupChapterPractice/savePractice",
    method: "post",
    data
  });
};
/* 章节练习继续做题 */
export const chapterContinueTest = data => {
  return http({
    url: "questionGroupChapterPractice/continueTest",
    method: "post",
    data
  });
};
/* 获取题库试卷列表 */
export const getQuestionBankPaperList = data => {
  return http({
    url: "questionGroupPaper/getPaperList",
    method: "post",
    data
  });
};
/* 获取单个试卷详细内容 */
export const getQuestionBankPaperOne = id => {
  return http({
    url: "questionGroupPaper/selectOne?id=" + id,
    method: "get"
  });
};
/* 获取试卷试题 */
export const getQuestionBankPaperDetail = data => {
  return http({
    url: "questionGroupPaper/getExamPaper",
    method: "post",
    data
  });
};
/* 提交考试 */
export const savePaper = data => {
  return http({
    url: "questionDonePaper/paper/autoCorrectSave",
    method: "post",
    data
  });
};
/* 考试回顾 */
export const getTestReview = data => {
  return http({
    url: "questionDonePaper/getFullDonePaper",
    method: "post",
    data
  });
};

/* 获取错题 */
export const getQuestionBankWrong = data => {
  return http({
    url: "questionGroupWrongQuestion/getWrongQuestion",
    method: "post",
    data
  });
};
/* 错题随练 */
export const getRandomWrongQuestion = data => {
  return http({
    url: "questionGroupWrongQuestion/getRandomWrongQuestion",
    method: "post",
    data
  });
};

/* 保存错题 */
export const saveQuestionBankWrong = data => {
  return http({
    url: "questionGroupWrongQuestion/save",
    method: "post",
    data
  });
};
/* 章节练习保存接口 错题重做保存接口 */
export const saveQuestionBankChapter = data => {
  return http({
    url: "questionGroupWrongQuestion/chapterSaveWrong",
    method: "post",
    data
  });
};
/* 错题随练 */
export const radomQuestionBankWrong = data => {
  return http({
    url: "questionGroupWrongQuestion/getRandomWrongQuestion",
    method: "post",
    data
  });
};
/* 获取错题总量 */
export const getQuestionBankWrongTotal = data => {
  return http({
    url: "questionGroupWrongQuestion/getWrongQuestionTotal",
    method: "post",
    data
  });
};
/* 获取考试练习错题列表 */
export const getExamWrong = data => {
  return http({
    url: "questionGroupWrongQuestion/getExamWrong",
    method: "post",
    data
  });
};
/* 获取专项训练错题列表 */
export const getSpecWrong = data => {
  return http({
    url: "questionGroupWrongQuestion/getSpecWrong",
    method: "post",
    data
  });
};
/* 题目收藏 */
export const saveCollection = data => {
  return http({
    url: "userCollect/save",
    method: "post",
    data
  });
};
/* 题目取消收藏 */
export const deleteCollection = id => {
  return http({
    url: "userCollect/" + id,
    method: "delete"
  });
};
/* 章节最后保存记录 */
export const saveLastDone = data => {
  return http({
    url: "questionChapterRecords/save",
    method: "post",
    data
  });
};
/* 获取章节练习进度和正确率 */
export const getChapterSchedule = data => {
  return http({
    url: "questionGroupChapterPractice/getSchedule",
    method: "post",
    data
  });
};
/* 章节最后修改记录 */
export const updateLastDone = data => {
  return http({
    url: "questionChapterRecords/update",
    method: "post",
    data
  });
};
/* 章节最后查询记录 */
export const getLastDone = id => {
  return http({
    url: "questionChapterRecords/selectOne?id=" + id,
    method: "get"
  });
};
/* 章节最后查询记录列表 */
export const getLastDoneList = data => {
  return http({
    url: "questionChapterRecords/list",
    method: "post",
    data
  });
};
/* 获取考试咨询板块 */
export const getExamInfoModule = data => {
  return http({
    url: "examInformation/list",
    method: "post",
    data
  });
};
/* 获取考试咨询列表 */
export const getExamInfoList = data => {
  return http({
    url: "examInformationItem/list",
    method: "post",
    data
  });
};
/* 获取考试咨询单个记录 */
export const getExamInfoOne = id => {
  return http({
    url: "examInformationItem/selectOne?id=" + id,
    method: "get"
  });
};
/* 获取考试咨询单个记录（有已读/未读） */
export const getExamInfoById = params => {
  return http({
    url: "examInformationItem/getById",
    method: "get",
    params
  });
};
/* 题库考试资讯更改状态 未读 为 已读 */
export const saveTestInfoStatus = data => {
  return http({
    url: "userInformationInfo/save",
    method: "post",
    data
  });
};
/* 获取考试记录 */
export const getExamRecord = data => {
  return http({
    url: "questionDonePaper/getExamRecords",
    method: "post",
    data
  });
};
/* 获取题库倒计时 */
export const getCountDownTimeOne = id => {
  return http({
    url: "examTime/selectOne?id=" + id,
    method: "get"
  });
};
/* 获取题库倒计时列表 */
export const getCountDownTime = data => {
  return http({
    url: "examTime/list",
    method: "post",
    data
  });
};
/* 保存题库倒计时 */
export const saveCountDownTime = data => {
  return http({
    url: "examTime/save",
    method: "post",
    data
  });
};
/* 修改题库倒计时 */
export const updateCountDownTime = data => {
  return http({
    url: "examTime/update",
    method: "post",
    data
  });
};

/* 删除全部章节做题记录 */
export const deleteAllChapterRecord = params => {
  return http({
    url: "questionGroupChapterPractice/clean",
    method: "get",
    params
  });
};



/* 获取历史成绩 */
export const getHistoryRecord = data => {
  return http({
    url: "questionDonePaper/getExamData",
    method: "post",
    data
  });
};
/* 获取上次做到的章节 */
export const getChapterLast = params => {
  return http({
    url: "questionChapterRecords/getLast",
    method: "get",
    params
  });
};
/* 错题随练做题保存 */
export const saveWrongPractice = data => {
  return http({
    url: "questionGroupWrongQuestion/saveWrong",
    method: "post",
    data
  });
};

/* 题库收藏列表 */
export const getCollectList = data => {
  return http({
    url: "userCollect/list",
    method: "post",
    data
  });
};